# coding=utf-8
# -*- coding: UTF-8 -*-
#
# This file is part of the kernelstudio package.
#
# (c) 2014-2025 zlin <admin@kernelstudio.com>
#
# For the full copyright and license information, please view the LICENSE file
# that was distributed with this source code.

from pydantic import Field
from pydantic_settings import BaseSettings


class LocalStorageConfig(BaseSettings):
    pass


class MinioStorageConfig(BaseSettings):
    MINIO_HOST: str = Field(
        default="http://127.0.0.1:9000",
        envvar='MINIO_HOST'
    )
    MINIO_ACCESS_KEY: str = Field(
        default="",
        envvar='MINIO_ACCESS_KEY'
    )
    MINIO_SECRET_KEY: str = Field(
        default="",
        envvar='MINIO_SECRET_KEY'
    )
    MINIO_BUCKET: str = Field(
        default="",
        envvar='MINIO_BUCKET'
    )


class StorageConfig(LocalStorageConfig, MinioStorageConfig):
    STORAGE_TYPE: str = Field(
        default="local",
        envvar='STORAGE_TYPE'
    )

    STORAGE_MAX_SIZE: str = Field(
        default="512m",
        envvar='STORAGE_MAX_SIZE'
    )


storage_config = StorageConfig()
